import { setUserStatus } from '@/api/system/systemAccount'
export default function useSortData() {
  const addDialogRef = ref()
  const delDialogRef = ref()
  // 添加
  const addFn = val => {
    console.log('修改')
    addDialogRef.value.show(val)
  }
  // 删除
  const delFn = () => {
    console.log('删除')
    delDialogRef.value.show()
  }
  // 切换
  const switchFn = async(val, id) => {
    console.log('切换', id, val)
    await setUserStatus(id, val)
  }

  return {
    addDialogRef,
    delDialogRef,
    addFn,
    delFn,
    switchFn
  }
}
